<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="root">
        <h2>当前n值{{n}}</h2>
        <h2>放大10倍n值<span v-big="n"></span></h2>
        <button @click="n++">点击按钮，n+1</button>
    </div>
    <script>
        new Vue({
            el: '#root',
            data: {
                name: '王万兴',
                n: 1
            },
            directives: {
                big(element, binding) {
                    element.innerText = binding.value * 10
                }
            }
        })
    </script>
</body>

</html>